package testAction

import com.sxdz.models.TSendInfo
import org.junit.Test
import testAction.base.BaseControllerTest

import java.text.DateFormat
import java.text.SimpleDateFormat

/**
 * Created by lzw on 2016/8/7.
 */

public class SendInfoActionTest extends BaseControllerTest {


    @Test
    void getAllSend(){
        Date date=new Date();
        DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time=format.format(date);
        System.out.print(time+"----");
        comm_get("/send/getList/oj-GvuEqxFYpz9JvAWt21ZiOIftA");
    }
    @Test
    void getAddSend(){
        //comm_get("/send/addSendInfo");
/*
        //sendInfo.setId(2);
        sendInfo.setUserId(123L)
        sendInfo.setAddress("浦东新区")
        sendInfo.setArea("地铁")
        sendInfo.setContactPhone("15721492770")
        sendInfo.setCity("上海")
        sendInfo.setStreet("sss");
        sendInfo.setContact("andy")
        sendInfo.setIsActive("2")
        sendInfo.setProvince("上海qw21")
        sendInfo.setIsDefault("2")*/


        Map<String,String> paramsMap=[:];
        paramsMap << [openid:"1"]
        paramsMap << [city:"ww"]
        paramsMap << [street:"wewewqqq"]
        paramsMap << [contact:"ww"]
        paramsMap << [contactPhone:"20000665665"]
        paramsMap << [province:"上海"]
        paramsMap << [area:"上海"]
        paramsMap << [isDefault:"1"]
        paramsMap << [zipCode:"1"]
        paramsMap << [address:"jdg0000001"]
        comm_post("/send/addSendInfo",paramsMap);

    }
    @Test
   void delSend(){
        comm_get("/send/delSend/36")
    }
    @Test
    void SS(){
        comm_get("/send/updataSendById/48")
    }
    @Test
    void getupdateSend() {
        Map<String, String> paramsMap = [:];
        paramsMap << [id:"51"]
        paramsMap << [city: "ww"]
        paramsMap << [street: "wewewqqq"]
        paramsMap << [contact: "ww"]
        paramsMap << [contactPhone: "20000665665"]
        paramsMap << [province: "上海22"]
        paramsMap << [area: "上海22"]
        paramsMap << [isDefault: "1"]
        paramsMap << [zipCode: "1"]
        paramsMap << [address: "jdg0000001"]
        comm_post("/send/updataSend", paramsMap);
    }
}
